<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>格式化标签</title>
  </head>
  <body>
    <!-- 
        pre标签,保留标签之间所有内容的原本格式 
        注意: 后面也可以使用css代替
    -->
    <pre>
        public class 递归算法 {
            public static void main(String[] args) {
                int factorial = getFactorial(5);
                System.out.println(factorial);
            }
        
            public static int getFactorial(int num) {
                if (num == 1) {
                    return 1;
                }
                return num * getFactorial(num - 1);
            }
        }
    </pre>
  </body>
</html>
